# -*- coding: utf-8 -*-
# @Time    : 2022/1/11 23:04
# @Author  : 徐翊宸
# @Email   : xyc@163.com
# @File    : page_scznx.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from pages.base_page import BasePage


class ScznxPage(BasePage):

    gengduo_locator = (By.LINK_TEXT, "更多")
    znx_locator = (By.LINK_TEXT, "站内信")
    xzk_locator = (By.CSS_SELECTOR, "#form1 > table > tbody > tr:nth-child(1) > td:nth-child(1) > input")
    plcz_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div > div.span12.nav > div > ul > li.nav.pull-left > div > a")
    shanchu_locator = (By.ID, "delete_receive")

    def gengduo_click(self):
        self.driver.find_element(*self.gengduo_locator).click()

    def znx_click(self):
        self.driver.find_element(*self.znx_locator).click()

    def xzk_click(self):
        self.driver.find_element(*self.xzk_locator).click()

    def plcz_click(self):
        self.driver.find_element(*self.plcz_locator).click()

    def shanchu_click(self):
        self.driver.find_element(*self.shanchu_locator).click()

    def alert_accept(self):
        self.driver.switch_to.alert.accept()



